package com.dzsw.duplicatedata;

import lombok.Data;

import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author sunz
 * @version 1.0
 * @CreateTime 2021-04-21-16:16
 */
@Data
public class SampleBean {

    private Long id;

    private String name;

    private int sex;

    private LocalDateTime birthday;

    public SampleBean(Long id, String name, int sex, LocalDateTime birthday) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.birthday = birthday;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SampleBean that = (SampleBean) o;
        return id.equals(that.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

    @Override
    public String toString() {
        return "SampleBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sex=" + sex +
                ", birthday=" + birthday +
                '}';
    }
}
